﻿using System.Windows.Media.Media3D;

namespace Wen.UI.NavigationElements
{
    internal class PointLightPositionViewModel : XyzControlViewModelBase
    {
        private readonly Point3D _stockPosition;
        private readonly PointLight _pointLight;

        internal PointLightPositionViewModel(PointLight pointLight) {
            _stockPosition = pointLight.Position;
            _pointLight = pointLight;
        }

        protected override void ApplyXMovement(double step) {
            _pointLight.Position = new Point3D(_pointLight.Position.X + step, _pointLight.Position.Y, _pointLight.Position.Z);
        }

        protected override void ApplyYMovement(double step) {
            _pointLight.Position = new Point3D(_pointLight.Position.X, _pointLight.Position.Y + step, _pointLight.Position.Z);
        }

        protected override void ApplyZMovement(double step) {
            _pointLight.Position = new Point3D(_pointLight.Position.X, _pointLight.Position.Y, _pointLight.Position.Z + step);
        }

        protected override void Reset() {
            _pointLight.Position = _stockPosition;
        }

    	protected override Point3D RawCoords
    	{
			get { return _pointLight.Position; }
    	}
    }
}
